package com.cntcdt.api.db.dao;

import java.util.List;

import com.cntcdt.api.db.dao.base.MaintenanceHistoryDaoBase;
import com.cntcdt.api.db.model.MaintenanceHistoryModel;

/**
 * 这是maintenance_history的Dao实现类
 */
public class MaintenanceHistoryDao extends MaintenanceHistoryDaoBase   {
    /**
     * MaintenanceHistoryDao对象
     */
    private static MaintenanceHistoryDao instance = new MaintenanceHistoryDao();

    /**
     * 默认构造方法
     */
    private MaintenanceHistoryDao() {
    }

    /**
     * 获得对象实例
     */
    public static MaintenanceHistoryDao getInstance() { 
         return instance;
    } 
    
    public List<MaintenanceHistoryModel> findByTerminalAndSortTime(String Terminal, int sortTime) {
    	sortTime = sortTime * 20;
        String sql = "SELECT * FROM " + TABLE + " WHERE terminal = ? order by addTime desc limit ?,20";
       Object[] paramObjs = {Terminal,sortTime};
       List<MaintenanceHistoryModel > modelList = this.queryModelList(sql, paramObjs);
       return modelList;
   }

}
